home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3178 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.0 KB  |  58 lines

  1. Newsgroups: comp.lang.c++,comp.lang.c,alt.msdos.programmer
  2. Path: netcom.com!xanthas
  3. From: xanthas@netcom.com (Mike Day)
  4. Subject: Error with Watcom's Graphics Routines
  5. Message-ID: <xanthasDLLDBp.LK7@netcom.com>
  6. Organization: NETCOM On-line Communication Services (408 261-4700 guest)
  7. X-Newsreader: TIN [version 1.2 PL1]
  8. Date: Mon, 22 Jan 1996 16:47:48 GMT
  9. Sender: xanthas@netcom19.netcom.com
  10.  
  11.  
  12. [ note:  this message is crossposted (because it relates to each) to the 
  13.   following newsgroups:
  14.     comp.lang.c
  15.     comp.lang.c++
  16.     alt.msdos.programmer ]
  17.  
  18. Hello...
  19.  
  20. I believe I have found an error in Watcom's Graphics Routines, 
  21. specifically, the ones used to detect the video configuration and cursor 
  22. position.
  23.  
  24. I have the following code I call a few times throught my program to 
  25. detect these things:
  26.  
  27.         // Get dimensions of screen
  28.         videoconfig vc;
  29.         _getvideoconfig(&vc);
  30.         oldrows = rows = vc.numtextrows;
  31.         oldcols = cols = vc.numtextcols;
  32.  
  33.         // Save the screen and position/color
  34.         oldcolor = _gettextcolor();
  35.         oldbkcolor = _getbkcolor();
  36.         screensaved = (rows * cols) << 1;
  37.         if (screensave) free(screensave);
  38.         screensave = (char *) malloc(screensaved);
  39.         if (screensave) memcpy(screensave,(void *)0x000b8000,screensaved);
  40.         oldpos = _gettextposition();
  41.  
  42. I used printf and a delay to see what this code got me each time I ran it,
  43. and it always gives me the same values for rows, cols, and oldpos as when
  44. I call it at the beginning of the program, even after changing text modes. 
  45. (80x50, 80x25, etc.)  It seems that watcom only detects this information at
  46. the beginning of a program and nowhere thereafter, even when you call its 
  47. functions.  I am changing the text mode with bios calls, not calls to the
  48. watcom graphics library, so perhaps that is a problem...
  49.  
  50. If you have experienced this problem, have suggestions or a solution, 
  51. please email me at the address in my .sig.
  52.  
  53. Thanks.
  54. --
  55. Mike Day   (Omni-)
  56. xanthas@netcom.com
  57.  
  58.